<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>购物车</title>

<link rel="stylesheet" href="${path }/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="${path }/assets/css/ie7.css">
<link rel="stylesheet" href="${path }/assets/css/style.css">
<link rel="stylesheet" href="${path }/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="${path }/assets/css/plugins.css">
<link rel='stylesheet' href="${path }/css/style.css" type='text/css' />

<link rel="stylesheet" href="${path }/css/carts.css">
<script type="text/javascript" src="${path }/js/jquery-1.11.1.min.js"></script>
</head>

<body>

	<header class="header-area header-sticky">
		<div class="header-container">
			<div class="row">
				<div class="col-lg-5 display-none-md display-none-xs">
					<div class="ht-main-menu">
						<nav>
							<ul>
								<li><a href="productIndex">首页</a>
								</li>
								<li><a href="productlist">水果展览</a></li>
								<li><a href="fruit.jsp">水果文化</a>
								</li>
								<li><a href="commentlist">精选评论</a></li>
								<li class="active"><a href="shopping.jsp">购物车</a></li>
								<li><a href="personalServlet">个人信息</a></li>
							</ul>
						</nav>
					</div>
				</div>

				<div class="col-lg-5 col-sm-8">
					<div class="header-content d-flex justify-content-end">
						<div class="search" style="background: url(assets/img/bg/11.jpg);">
							<div class="search_form">
								<form action="${path }/Search" method="get">
									<input type="text" name="searchWord" placeholder="你要搜寻的商品..."  style="background:url(assets/img/bg/11.jpg);width: 150px;border: 1px solid #aaa;">
									<input type="submit" value="搜索" style="background:url(assets/img/bg/11.jpg);width: 50px;height: 34px;text-align: center;font-size: 13px;
									">
								</form>
							</div>
						</div>

						<div class="settings-wrapper">
							<a style="width: 90px; font-size: 12px;">欢迎您,<i>${username.username }</i></a>
						</div>

						<div class="settings-wrapper">
							<a href="login.jsp">
								<input style="position: absolute; border: none;width: 70px;height: 40px;font-size: 12px;color: orangered; background: url(assets/img/bg/11.jpg);" type="submit" name="" value="点击退出" />
							</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</header>

	<section class="cartMain">
		<div style="font-size: 20px;">
			<a href="clearCart">清空购物车</a>
		</div>
		<div class="cartMain_hd">
			<ul class="order_lists cartTop">
				<li class="list_chk">
					<!--所有商品全选--> <input type="checkbox" id="all" class="whole_check">
					<label for="all"></label> 全选
				</li>
				<li class="list_con">商品名</li>
				<li class="list_info">商品描述</li>
				<li class="list_price">单价</li>
				<li class="list_amount">数量</li>
				<li class="list_sum">金额</li>
				<li class="list_op">操作</li>
			</ul>
		</div>
		<c:if test="${empty(cart.map) }">
			<div style="font-size: 14px; color: red; text-align: center;">您还没购任何商品</div>
		</c:if>
		<c:if test="${!empty(cart.map) }">
			<c:forEach items="${cart.map}" var="m">
				<div class="cartBox">

					<div class="order_content">
						<ul class="order_lists">
							<li class="list_chk"><input type="checkbox" id="checkbox_6"
								class="son_check"> <label for="checkbox_6"></label></li>

							<li class="list_con">
								<div class="list_img">
									<a><img
										src="${path }/assets/img/featured/${m.value.product.listimg }"></a>
								</div>
								<div class="list_text">
									<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${m.value.product.name}</p>
								</div>
							</li>
							<li class="list_info">
								<p>${m.value.product.description}</p>
							</li>
							<li class="list_price">
								<p class="price">￥${m.value.product.price}</p>
							</li>
							<li class="list_amount">
								<div class="amount_box">${m.value.count}</div>
							</li>
							<li class="list_sum">
								<p class="sum_price">￥${m.value.price}</p>
							</li>
							<li class="list_op">
								<p class="del">
									<a href="deleteItem?id=${m.value.product.id}">移除商品</a>
								</p>
							</li>
						</ul>
					</div>
				</div>
			</c:forEach>
		</c:if>

		<!--底部-->
		<div class="bar-wrapper">
			<div class="bar-right">
				<div class="totalMoney">
					共计: <strong class="total_text">￥${cart.price}</strong>
				</div>
				<div class="calBtn">
					<a href="payCart">结算</a>
				</div>
			</div>
		</div>
	</section>

	<script src="${path }/assets/js/vendor/jquery-3.2.1.min.js"></script>
	<script src="${path }/assets/js/bootstrap.min.js"></script>
	<script src="${path }/assets/js/plugins.js"></script>
	<script src="${path }/assets/js/ajax-mail.js"></script>
	<script src="${path }/assets/js/main.js"></script>
	<script type="text/javascript">
								var msg = '${msg}'
								if (msg != null && msg != '') {
									alert(msg);
								} else {
								
								}
		</script>
</body>
<script src="${path }/js/jquery-1.11.1.min.js"></script>
<script src="${path }/js/carts.js"></script>
</html>